#ifndef TRACKINGDEVICE_H
#define TRACKINGDEVICE_H

#include "tracker.h"

namespace Tracking
{
	class TrackingDevice
	{
	public:
		TrackingDevice(DeviceType type)
		{
			_running = false;
			_sensorToObject = mat4f::IDENTITY;
			_type = type;
		}

		virtual ~TrackingDevice(){}
		void setSensorToObject( const mat4f& matrix )
            { _sensorToObject = matrix; }

		const DeviceType& getDeviceType()
			{ return _type; }

		virtual bool init() = 0;

		virtual bool update() = 0;

		virtual void uninit() = 0;

		bool isRunning()
			{ return _running; }

		mat4f& getSensorToObject()
			{ return _sensorToObject; }

	protected:
		DeviceType _type;
		/*sensor to object transformation */
		mat4f _sensorToObject;
		/*Indicates if Tracker is running */
		bool _running;
	};

	class TestDevice : public TrackingDevice
	{
	public:
		TestDevice() : TrackingDevice(DeviceType::KINECT) {}
		~TestDevice() {};
	
		bool init(){ _running = true; return true;}

		bool update(){return true;}

		void uninit(){}
	};
}

#endif